package com.example.tests;

import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;

import com.example.framework.AppUnderTest;

public class BaseTestSetUp {
	
	//protected static final String MY_ACCOUNT = "my/account";
	//protected static final String ACCOUNT_REGISTER = "account/register";
	//protected static final String HTTP_DEMO_REDMINE_ORG = "http://demo.redmine.org/";
	//static WebDriver driver;
	//static String baseUrl;
	//static StringBuffer verificationErrors = new StringBuffer();
	
	public static AppUnderTest app;

	@BeforeTest(alwaysRun=true)
	public static void setUp() throws Exception {
		app = AppUnderTest.getInstance(app.HTTP_DEMO_REDMINE_ORG, "firefox");
	}

	@AfterTest(alwaysRun=true)
	public static void tearDown() throws Exception {
		app.driver.quit();
		String verificationErrorString = app.verificationErrors.toString();
		if (!"".equals(verificationErrorString)) {
			Assert.fail(verificationErrorString);
		}
	}
}